import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
const { resolve } = require('path')

// https://vitejs.dev/config/
export default defineConfig({
  base: "", // 部署时的根目录
  build: {
    manifest: true,
    minify: true,
    assetsDir: 'assert',
    rollupOptions: {
      input: {
        main: resolve(__dirname, 'index.html'),      // 入口页面
        error: resolve(__dirname, 'error/404.html'),
      },
      output: {
        manualChunks:{
          // element: ['element-plus'],
          vendor: ['vue', 'axios', 'vuex', 'vue-router']
        }
      }
    }
  },
  optimizeDeps: {
    include: ['vue']
  },
  server: {
    port: 9080
  },
  plugins: [vue()]
})
